class MemosController < BaseController

  def index
    @memos = Memo.all
  end

  def new
    @memo = Memo.new
  end

  def show
    @memo = Memo.find(params[:id])
  end

  def create
  	@washroom = Washroom.where(id:params[:room]).first
  	@memo = Memo.new(memo_params)
    @memo.bian_count = 5
  	@memo.washroom_id = @washroom.id if @washroom
    @memo.save
  	redirect_to memos_url
  end


  private

    def set_memo
      @city = City.find(params[:id])
    end

    def memo_params
      params.permit(:title, :content)
    end

end
